<?php

/**
 * AbetRoom filter form base class.
 *
 * @package    sfproject
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAbetRoomFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'room_num'         => new sfWidgetFormFilterInput(),
      'room_type'        => new sfWidgetFormFilterInput(),
      'stu_t'            => new sfWidgetFormFilterInput(),
      'has_dis_teach_eq' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'build_name'       => new sfWidgetFormFilterInput(),
      'created_at'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'updated_at'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'room_num'         => new sfValidatorPass(array('required' => false)),
      'room_type'        => new sfValidatorPass(array('required' => false)),
      'stu_t'            => new sfValidatorPass(array('required' => false)),
      'has_dis_teach_eq' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'build_name'       => new sfValidatorPass(array('required' => false)),
      'created_at'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('abet_room_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetRoom';
  }

  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'room_num'         => 'Text',
      'room_type'        => 'Text',
      'stu_t'            => 'Text',
      'has_dis_teach_eq' => 'Boolean',
      'build_name'       => 'Text',
      'created_at'       => 'Date',
      'updated_at'       => 'Date',
    );
  }
}
